package com.jy.service.impl;

import com.jy.bean.User;
import com.jy.dao.UserDao;
import com.jy.service.UserService;

import java.util.List;

public class UserServicelmpl implements UserService {
    private UserDao userDao;

    @Override
    public boolean register(User user) {
        userDao = new UserDao();
        return userDao.register(user);
    }

    @Override
    public boolean seleuser(String Emailbox,String name) {
        userDao = new UserDao();
        return userDao.seleuser(Emailbox,name);
    }

    @Override
    public boolean selelogin(String name, String password) {
        userDao = new UserDao();
        return  userDao.selelogin(name,password);
    }

    @Override
    public boolean seleadmin(String admin, String password) {
        userDao = new UserDao();
        return userDao.seleadmin(admin,password);
    }

    @Override
    public List<User> selectuser() {
        userDao = new UserDao();
        return userDao.selectuser();
    }

    @Override
    public List<User> selectByParams(User params) {
        userDao = new UserDao();
        return userDao.selectByParams(params);
    }

    @Override
    public List<User> selectByname(String name) {
        userDao = new UserDao();
        return userDao.selectByname(name);
    }

    @Override
    public Boolean UpdateUser(User user) {
        userDao = new UserDao();
        return userDao.UpdateUser(user);
    }

    @Override
    public Boolean Delete_user(String name) {
        userDao = new UserDao();
        return userDao.Delete_user(name);
    }

    @Override
    public List<User> select_user(String name) {
        userDao = new UserDao();
        return userDao.select_user(name);
    }

    @Override
    public boolean update_user(User user) {
        userDao = new UserDao();
        return userDao.update_user(user);
    }

    @Override
    public boolean update_passwrod(User user) {
        userDao = new UserDao();
        return userDao.update_passwrod(user);
    }
}
